#include<iostream>
#include<cmath>
#include<fstream>
#include<string>
using namespace std;

#include"library.h"

double g(double x){

	return x*x - 4*x -5;
}

int main(){
	
	double a=0, b=1, c;

	while( g(a) * g(b) >0 ){
		cout<<"Input valid boundaries inside which we get a root."<<endl;
		cout<<"a=";
		cin>>a;
		cout<<"b=";
		cin>>b;
	}

	cout<<" The root is x="<<(c=bisection(g,a,b,1E-9))<<" f(x)="<<g(c)<<endl;
	return 0;
}
